import java.util.Scanner;

public class zy18 {
	public static void main(String[] args) {
		Scanner r=new Scanner(System.in);
		int n=r.nextInt();
        int a[][]=new int[n][n],i,j,k,hang=0,lie=n/2;
        for(k=1;k<=n*n;k++){
        	a[hang][lie]=k;
        	hang--;
        	lie++;
        	if(hang<0&&lie>=n)
        	{
        		hang=hang+2;
        		lie--;
        	}
        	if(hang<0)
        		hang=n-1;
        	if(lie>=n)
        		lie=0;
        	if(a[hang][lie]!=0)
        	{
        		hang=hang+2;
        		lie--;
        	}
        }
        for(i=0;i<n-1;i++){
        	for(j=0;j<=n-1;j++)
        		System.out.printf("%4d",a[i][j]);
        	System.out.println();
        }
        r.close();
	}
}
